package com.paullorenc.rose.desktop

import com.paullorenc.rose.desktop.conversation.ConversationViewModel
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.collect

object IncomingMessageBus {
    private val _incoming = MutableSharedFlow<String>()
    val incoming = _incoming.asSharedFlow()
    suspend fun postMessage(string: String) {
        _incoming.emit(string)
    }
}

object OutgoingMessageBus {
    private val _outgoing = MutableSharedFlow<String>()
    val outgoing = _outgoing.asSharedFlow()
    suspend fun postMessage(string: String) {
        _outgoing.emit(string)
    }
}

object ForwardMessageBus {
    private val _forward = MutableSharedFlow<String>()
    val forward = _forward.asSharedFlow()
    suspend fun postMessage(string: String) {
        _forward.emit(string)
    }
}
